home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d8 / tadex10.arc / EXEC.SLT next >
Text File  |  1989-04-23  |  3KB  |  94 lines

  1. //                                EXEC.SLT
  2. //                              Version 1.00
  3. //
  4. //                             By John Abatte
  5. //                             April 22, 1989
  6. //
  7. // This is the main Logon script for EXEC-PC, to be used with EXECTIME.SLT.
  8. // The two areas to modify are imediately below and should be pretty self
  9. // explanatory. This script may also be used by itself as a logon script.
  10. // To disable the download feature, either comment out the last line by
  11. // putting a double slash in front of "call("download.slc);", or by simply
  12. // deleting the line.
  13.  
  14.  
  15. str user_name[32] = "John;Abatte";              // Put YOUR name here
  16. str cap_file[60] = "c:\telix\cap\exec-pc.cap";  // YOUR cap dir here
  17.  
  18. main()
  19. {
  20.  int stat;
  21.  int tm;
  22.  int t1,t2,t3,t4,t5,t6;
  23.  
  24.  _scr_chk_key = 1;
  25.  
  26.  flushbuf();
  27.  alarm(1);                             // delete if using timed script
  28.  capture("*CLOSE*");                   // close any open capture file
  29.  capture(cap_file);                    // open CAP file for EXEC session
  30.  
  31.  
  32.  t1 = track("FIRST name ->", 0);
  33.  t2 = track("Password ->", 0);
  34.  t3 = track("updated bulletins", 0);
  35.  t4 = track("continue ->", 0);
  36.  t5 = track("0 messages found", 0);
  37.  t6 = track("WXG, ?=HELP) ->", 0);
  38.  
  39.  tm = timer_start(1800);               // wait up to 3 minutes for login
  40.  
  41.  while (not time_up(tm))
  42.    {
  43.     terminal();                        // let Telix process any chars and keys
  44.     stat = track_hit(0);               // see which (if any) track was hit
  45.  
  46.     if (stat == t1)                    // send name
  47.       {
  48.        delay_scr(1);
  49.        cputs(user_name);
  50.        cputs("^M");
  51.       }
  52.     if (stat == t2)                    // send password
  53.       {
  54.        delay_scr(1);
  55.        cputs(_entry_pass);
  56.        cputs("^M");
  57.       }
  58.     if (stat == t3)                    // skip the bulletins
  59.       {
  60.        delay_scr(10);
  61.        cputs("q");
  62.       }
  63.     if (stat == t4)                    // "continue"
  64.       {
  65.        delay_scr(1);
  66.        cputs("^M");
  67.       }
  68.     if ((stat != t5) && (stat == t6))
  69.       {
  70.        delay_scr(2);
  71.        cputs("r");                     // read our mail
  72.        delay_scr(1);
  73.        cputs("n");
  74.        break;                          // end Logon sequence
  75.       }
  76.    }
  77.  
  78.  if (time_up(1))                       // force a hangup if timeout
  79.    {
  80.     prints("Logon failed!");
  81.     hangup();
  82.     capture("*CLOSE*");
  83.    }
  84.  timer_free(tm);                       // free timer channel
  85.  track_free(0);                        // and all track channels
  86.  if(waitfor("WXG, ?=HELP) ->",1200))   // wait up to 2 min for mail read
  87.    {
  88.     delay_scr(1);
  89.     cputs("fa");
  90.    }
  91.  call("download.slc");                 // start the download script
  92.  
  93. }              
  94.